package com.yundasys.lab14springbootmessage.lab14springbootmessage.service;

import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.common.message.MessageExt;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Service;

/**
 * @PACKAGE_NAME: com.yundasys.lab14springbootmessage.lab14springbootmessage.service
 * @NAME: PushMessageServiceImpl
 * @USER: jiangta
 * @DATE: 2021/12/24
 * @TIME: 11:28 上午
 * @PROJECT_NAME: springboot-labs
 */
@Service
@Slf4j
@RocketMQMessageListener(
        topic = "DEMO_01",
        consumerGroup = "demo01-consumer-group-DEMO_01"
)
public class PushMessageServiceImpl implements RocketMQListener<MessageExt> {


    @Override
    public void onMessage(MessageExt message) {
        log.info("[onMessage][线程编号:{} 消息内容：{}]", Thread.currentThread().getId(), message);
    }
}
